<template>
    <LoginHeader>欢迎登陆</LoginHeader>
    <!-- 主体登录区域 -->
    <section class="login-section">
      <div class="wrapper">
        <nav>
          <a @click="activeName='account'" href="javascript:;" :class="{active:activeName==='account'}">账户登录</a>
          <a @click="activeName='prcode'" href="javascript:;" :class="{active:activeName=== 'qrcode'}">扫码登陆</a>
        </nav>
        <!-- 账号登陆与扫码登陆 -->
        <LoginFrom v-if="activeName==='account'"></LoginFrom>
        <div v-if="activeName==='prcode'" class="qrcode-box">
        <img src="@/assets/images/qrcode.jpg"  alt="">
        <p>打开<a href="javascript:;">小兔鲜App</a>扫码登陆</p>
        </div>
      </div>
    </section>
    <LoginFooter />
</template>
<script>
import LoginHeader from '@/views/login/components/login-header.vue'
import{ ref} from 'vue'
import LoginFooter from '@/views/login/components/login-foot.vue'
import LoginFrom from '@/views/login/components/login-form.vue'

export default {
  name: 'PageLogin',
  components:{
      LoginHeader,
      LoginFooter,
      LoginFrom
  },
  setup(){
      const activeName=ref('account')
      return {activeName}
  }
}

</script>
<style scoped lang='less'>
.login-section {
  background: url(../../assets/images/login-bg.png) no-repeat center / cover;
  height: 488px;
  position: relative;
  .wrapper {
    width: 380px;
    background: #fff;
    min-height: 380px;
    position: absolute;
    left: 50%;
    top: 54px;
    transform: translate3d(100px,0,0);
    box-shadow: 0 0 10px rgba(0,0,0,.15);
    nav {
      font-size:14px;
      height: 55px;
      margin-bottom: 20px;
      border-bottom: 1px solid #f5f5f5;
      display: flex;
      padding: 0 40px;
      text-align: right;
      align-items: center;
      a {
        flex: 1;
        line-height: 1;
        display: inline-block;
        font-size: 18px;
        position: relative;
        text-align: center;
        &:first-child{
        border-right:1px solid #f5f5f5;
        text-align: left;
        }
        &.active{
        color: @xtxColor;
        font-weight: bold;}
      }
    }
  }
}
 /*二维码容器*/
 .qrcode-box{
 text-align: center;
 padding-top: 40px;
 p{
 margin-top:20px;

 }
 a{
 color:@xtxColor;
 font-size: 16px;}
 }
 
</style>